package com.hmall.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class PasswordEncoder {
    private static final BCryptPasswordEncoder BCRYPT = new BCryptPasswordEncoder();

    public static String encode(String password) {
        return BCRYPT.encode(password);
    }

    public static boolean matches(String rawPassword, String encodedPassword) {
        return BCRYPT.matches(rawPassword, encodedPassword);
    }
}